class ScoreException(Exception):

    def __init__(self,score,min_score,max_score):
        self.score = score
        self.min_score = min_score
        self.max_score = max_score

    def __str__(self):
        return "分数必须在{}到{}之间，当前分数为{}，不符合要求，请重新输入".format(self.min_score,self.max_score,self.score)

def score_update():
    score = int(input("请输入成绩："))
    min_score = int(input("请输入成绩的最小值："))
    max_score = int(input("请输入成绩最大值："))
    if score <= min_score or score >= max_score:
        raise ScoreException(score,min_score,max_score)
    if score < 60:
        print("E")
    elif score < 70:
        print("D")
    elif score < 80:
        print("C")
    elif score < 90:
        print("B")
    else:
        print("A")

if __name__ == '__main__':
    while True:
        try:
            score_update()
        except Exception as e:
            print("输入的成绩有误，错误信息：", e)
        flag = int(input("请选择是否继续（任意数字继续，-1退出）："))
        if flag == -1:
            break